<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <title><%= locals.title %></title>
    <link rel="stylesheet" href="/stylesheets/bootstrap.min.css">
    <link rel="stylesheet" href="/stylesheets/bootstrap-responsive.min.css">
    <style>
    body { padding-top: 60px; padding-bottom: 40px; }
    </style>
</head>
<body>
    <div class="navbar navbar-fixed-top">
        <div class="navbar-inner">
            <div class="container">
                <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </a>
                <a href="/" class="brand">Microblog</a>
                <div class="nav-collapse">
                    <ul class="nav">
                        <li class="active"><a href="/">首页</a></li>
                        <% if (!user) { %>
                            <li><a href="/login">登录</a></li>
                            <li><a href="/reg">注册</a></li>
                        <% } else { %>
                            <li><a href="/logout">登出</a></li>
                        <% } %>
                    </ul>
                </div>
            </div>
        </div>
    </div>

    <div class="container" id="container">
        <% if (success) { %>
            <div class="alert alert-success">
                <%= success %>
            </div>
        <% } %>
        <% if (error) { %>
            <div class="alert alert-error">
                <%= error %>
            </div>
        <% } %>

        <%- body %>
        <hr>
        <footer>
            <p><a href="http://www.byvoid.com" target="_blank">BYVoid</a> 2012</p>
        </footer>
    </div>
    <script src="/javascripts/jquery.min.js"></script>
    <script src="/javascripts/bootstrap.min.js"></script>
</body>
</html>